﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ReviewList.aspx.cs" Inherits="Pages_Admin_ReviewList" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>    
    <script type="text/javascript"  src="../../JS/datatime.js"></script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <fieldset style="width:746px; padding:10px">
            <legend>筛选条件</legend>
            <label>商品名称：</label>
            <asp:DropDownList ID="ProductName" runat="server" DataSourceID="ProdName" 
                DataTextField="ProductName" DataValueField="ProductID" >
            </asp:DropDownList>
            &nbsp;<br />
            <label>留言状态：</label>
            <asp:DropDownList runat="server" ID="ReviewCondition">
                <asp:ListItem Text="选择..." Value="0" Selected="True"></asp:ListItem>
                <asp:ListItem Text="已回复" Value="1"></asp:ListItem>
                <asp:ListItem Text="待回复" Value="2"></asp:ListItem>
            </asp:DropDownList>
            &nbsp;&nbsp; 留言日期：<asp:TextBox ID="txtkey" onblur="showHint(this,1)" onkeypress="return false"  onselectstart="return false;" onfocus="showHint(this,10,'outDate')" runat="server" Width="80px"></asp:TextBox>
            &nbsp;&nbsp;网友提问：<asp:TextBox ID="txtProblemName" runat="server" ></asp:TextBox>
            &nbsp;&nbsp;<asp:Button ID="Button1" runat="server" Height="29px" Text="搜索" Width="114px" onclick="Button1_Click" />
        </fieldset>
       <pan:SmartGridView ID="GridView1" runat="server" AllowPaging="True"  DataKeyNames="ReviewID"
            AllowSorting="True" AutoGenerateColumns="False" BackColor="White"  PageSize="15"
            BorderColor="#999999" BorderStyle="None" BorderWidth="1px" CellPadding="3" 
            DataSourceID="ReviewList" GridLines="Vertical">
            <RowStyle BackColor="#EEEEEE" ForeColor="Black" />
            <Columns>
                <asp:BoundField DataField="ProductName" HeaderText="产品名称" 
                    SortExpression="ProductName">
                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="120px" />
                </asp:BoundField>
                <asp:BoundField DataField="Body" HeaderText="问题" SortExpression="Body">
                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="200px" 
                    Wrap="False" />
                </asp:BoundField>
                <asp:BoundField DataField="Reply" HeaderText="回复" SortExpression="Reply">
                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="200px" 
                    Wrap="False" />
                </asp:BoundField>
                <asp:BoundField DataField="CreateOn" HeaderText="提问时间" 
                    SortExpression="CreateOn">
                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="120px" />
                </asp:BoundField>
                <asp:HyperLinkField DataNavigateUrlFields="ReviewID" 
                    DataNavigateUrlFormatString="ReviewAnswer.aspx?rid={0}" 
                    NavigateUrl="~/Pages/Admin/ReviewAnswer.aspx" Text="回答该问题" />
                     <asp:TemplateField HeaderText="删除">
                    <ItemTemplate>
                        <asp:LinkButton CommandName="Delete" Text="删除" OnClientClick="javascript:return confirm('你确认要删除此商品吗！')" runat="server" ID="delCmd"></asp:LinkButton>
                    </ItemTemplate>
                 </asp:TemplateField>
            </Columns>
            <FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
            <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#008A8C" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#000084" Font-Bold="True" ForeColor="White" />
            <AlternatingRowStyle BackColor="#DCDCDC" />
            <CustomPagerSettings PagingMode="Webabcd" TextFormat="每页{0}条/共{1}条  第{2}页/共{3}页   " />
              <PagerSettings Position="Bottom" PageButtonCount="13" FirstPageText="首页" PreviousPageText="上一页"
            NextPageText="下一页" LastPageText="末页" />
            <FooterStyle BackColor="#CCCCCC" ForeColor="Black" />
        <EmptyDataTemplate>
        <div style='text-align:left;margin-left:20px; width:100%;margin-bottom:10px;'>
		   <p style='color:#FF4E00;font-size:14px;font-weight:bold;'> 抱歉！没有搜索到相关信息 ！<br /><br /></p>
			可能的原因有：<br />
			1、不匹配<br />
			2、没有满足搜索条件的信息。<br /></div>
        </EmptyDataTemplate>
         </pan:SmartGridView>
    
    </div>
<%--    <asp:SqlDataSource ID="SqlDataSourceReview" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        SelectCommand="SELECT * FROM [Review] ORDER BY [CreateOn] DESC, [ProductID], [UserID]">
    </asp:SqlDataSource>--%>
    <asp:ObjectDataSource ID="ReviewList" runat="server" 
        OldValuesParameterFormatString="{0}" 
        SelectMethod="GetReviewListBySearch" TypeName="Tuan.BLL.Review" 
        DeleteMethod="Delete">
        <DeleteParameters>
            <asp:Parameter Name="ReviewID" Type="Int32" />
        </DeleteParameters>
        <SelectParameters>
            <asp:ControlParameter ControlID="ProductName" Name="productid" 
                PropertyName="SelectedValue" Type="Int32" />
            <asp:ControlParameter ControlID="ReviewCondition" Name="conditionid" 
                PropertyName="SelectedValue" Type="Int32" />
            <asp:ControlParameter ControlID="txtkey" Name="date" PropertyName="Text" 
                Type="String" />
            <asp:ControlParameter ControlID="txtProblemName" Name="ProblemName" 
                PropertyName="Text" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>
    <asp:ObjectDataSource ID="ProdName" runat="server" 
        OldValuesParameterFormatString="original_{0}" SelectMethod="GetProductName" 
        TypeName="Tuan.BLL.Review"></asp:ObjectDataSource>
    </form>
</body>
</html>
